(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Rewrite Strategy: FULL

(1) DecreasingLoopProof (EQUIVALENT transformation)

The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
concat(cons(u, v), y) →+ cons(u, concat(v, y))
gives rise to a decreasing loop by considering the right hand sides subterm at position [1].
The pumping substitution is [v / cons(u, v)].
The result substitution is [ ].

(2) BOUNDS(n^1, INF)

(3) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

(4) Obligation:

Runtime Complexity Relative TRS:
The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

S is empty.
Rewrite Strategy: FULL

(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(6) Obligation:

TRS:
Rules:
isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Types:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false
hole_true:false1_0 :: true:false
hole_leaf:cons2_0 :: leaf:cons
gen_leaf:cons3_0 :: Nat → leaf:cons

(7) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
concat, less_leaves

They will be analysed ascendingly in the following order:
concat < less_leaves

(8) Obligation:

TRS:
Rules:
isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Types:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false
hole_true:false1_0 :: true:false
hole_leaf:cons2_0 :: leaf:cons
gen_leaf:cons3_0 :: Nat → leaf:cons

Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))

The following defined symbols remain to be analysed:
concat, less_leaves

They will be analysed ascendingly in the following order:
concat < less_leaves

(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)

Induction Base:
concat(gen_leaf:cons3_0(0), gen_leaf:cons3_0(b)) →RΩ(1)
gen_leaf:cons3_0(b)

Induction Step:
concat(gen_leaf:cons3_0(+(n5_0, 1)), gen_leaf:cons3_0(b)) →RΩ(1)
cons(leaf, concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b))) →IH
cons(leaf, gen_leaf:cons3_0(+(b, c6_0)))

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(10) Complex Obligation (BEST)

(11) Obligation:

TRS:
Rules:
isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Types:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false
hole_true:false1_0 :: true:false
hole_leaf:cons2_0 :: leaf:cons
gen_leaf:cons3_0 :: Nat → leaf:cons

Lemmas:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)

Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))

The following defined symbols remain to be analysed:
less_leaves

(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
less_leaves(gen_leaf:cons3_0(+(1, n548_0)), gen_leaf:cons3_0(n548_0)) → false, rt ∈ Ω(1 + n5480)

Induction Base:
less_leaves(gen_leaf:cons3_0(+(1, 0)), gen_leaf:cons3_0(0)) →RΩ(1)
if1(isLeaf(gen_leaf:cons3_0(+(1, 0))), isLeaf(gen_leaf:cons3_0(0)), gen_leaf:cons3_0(+(1, 0)), gen_leaf:cons3_0(0)) →RΩ(1)
if1(false, isLeaf(gen_leaf:cons3_0(0)), gen_leaf:cons3_0(1), gen_leaf:cons3_0(0)) →RΩ(1)
if1(false, true, gen_leaf:cons3_0(1), gen_leaf:cons3_0(0)) →RΩ(1)
false

Induction Step:
less_leaves(gen_leaf:cons3_0(+(1, +(n548_0, 1))), gen_leaf:cons3_0(+(n548_0, 1))) →RΩ(1)
if1(isLeaf(gen_leaf:cons3_0(+(1, +(n548_0, 1)))), isLeaf(gen_leaf:cons3_0(+(n548_0, 1))), gen_leaf:cons3_0(+(1, +(n548_0, 1))), gen_leaf:cons3_0(+(n548_0, 1))) →RΩ(1)
if1(false, isLeaf(gen_leaf:cons3_0(+(1, n548_0))), gen_leaf:cons3_0(+(2, n548_0)), gen_leaf:cons3_0(+(1, n548_0))) →RΩ(1)
if1(false, false, gen_leaf:cons3_0(+(2, n548_0)), gen_leaf:cons3_0(+(1, n548_0))) →RΩ(1)
if2(false, gen_leaf:cons3_0(+(2, n548_0)), gen_leaf:cons3_0(+(1, n548_0))) →RΩ(1)
less_leaves(concat(left(gen_leaf:cons3_0(+(2, n548_0))), right(gen_leaf:cons3_0(+(2, n548_0)))), concat(left(gen_leaf:cons3_0(+(1, n548_0))), right(gen_leaf:cons3_0(+(1, n548_0))))) →RΩ(1)
less_leaves(concat(leaf, right(gen_leaf:cons3_0(+(2, n548_0)))), concat(left(gen_leaf:cons3_0(+(1, n548_0))), right(gen_leaf:cons3_0(+(1, n548_0))))) →RΩ(1)
less_leaves(concat(leaf, gen_leaf:cons3_0(+(1, n548_0))), concat(left(gen_leaf:cons3_0(+(1, n548_0))), right(gen_leaf:cons3_0(+(1, n548_0))))) →LΩ(1)
less_leaves(gen_leaf:cons3_0(+(0, +(1, n548_0))), concat(left(gen_leaf:cons3_0(+(1, n548_0))), right(gen_leaf:cons3_0(+(1, n548_0))))) →RΩ(1)
less_leaves(gen_leaf:cons3_0(+(1, n548_0)), concat(leaf, right(gen_leaf:cons3_0(+(1, n548_0))))) →RΩ(1)
less_leaves(gen_leaf:cons3_0(+(1, n548_0)), concat(leaf, gen_leaf:cons3_0(n548_0))) →LΩ(1)
less_leaves(gen_leaf:cons3_0(+(1, n548_0)), gen_leaf:cons3_0(+(0, n548_0))) →IH
false

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(13) Complex Obligation (BEST)

(14) Obligation:

TRS:
Rules:
isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Types:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false
hole_true:false1_0 :: true:false
hole_leaf:cons2_0 :: leaf:cons
gen_leaf:cons3_0 :: Nat → leaf:cons

Lemmas:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
less_leaves(gen_leaf:cons3_0(+(1, n548_0)), gen_leaf:cons3_0(n548_0)) → false, rt ∈ Ω(1 + n5480)

Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))

No more defined symbols left to analyse.

(15) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)

(16) BOUNDS(n^1, INF)

(17) Obligation:

TRS:
Rules:
isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Types:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false
hole_true:false1_0 :: true:false
hole_leaf:cons2_0 :: leaf:cons
gen_leaf:cons3_0 :: Nat → leaf:cons

Lemmas:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
less_leaves(gen_leaf:cons3_0(+(1, n548_0)), gen_leaf:cons3_0(n548_0)) → false, rt ∈ Ω(1 + n5480)

Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))

No more defined symbols left to analyse.

(18) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)

(19) BOUNDS(n^1, INF)

(20) Obligation:

TRS:
Rules:
isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Types:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false
hole_true:false1_0 :: true:false
hole_leaf:cons2_0 :: leaf:cons
gen_leaf:cons3_0 :: Nat → leaf:cons

Lemmas:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)

Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))

No more defined symbols left to analyse.

(21) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)

(22) BOUNDS(n^1, INF)